Build a Recommender for Reviewer Suggestion Until now, reviewer suggestion was purely based on a search. I've built a small recommender to improve the suggestions based on past contributions by the individual reviewers and added an extension point so that people can customize this feature. The built-in recommender makes a default suggestion of reviewers before the user types a query. These are based on people that have reviewed the last contributions that a user made. If the user starts typing in the box, we generate a list of candidates using the account index and feed it into a small recommender. The recommender ranks the list by looking at recent contributions of the candidates made in the same project. Contributions include reviews, owned-changes and comments at different weights. Change-Id: I5aca23ddd2442146fd26bdc12e7c18da85de7ac1 
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt index 3260e23..bed3760 100644 --- a/Documentation/dev-plugins.txt +++ b/Documentation/dev-plugins.txt 
@@ -2399,6 +2399,41 @@  ----     +[[reviewer-suggestion]] +== Reviewer Suggestion Plugins + +Gerrit provides an extension point that enables Plugins to rank +the list of reviewer suggestion a user receives upon clicking "Add Reviewer" on +the change screen. +Gerrit supports both a default suggestion that appears when the user has not yet +typed anything and a filtered suggestion that is shown as the user starts +typing. +Plugins receive a candidate list and can return a Set of suggested reviewers +containing the Account.Id and a score for each reviewer. +The candidate list is non-binding and plugins can choose to return reviewers not +initially contained in the candidate list. +Server administrators can configure the overall weight of each plugin using the +weight config parameter on [addreviewer "<pluginName-exportName>"]. + +[source, java] +---- +import com.google.gerrit.server.change.ReviewerSuggestion; +import com.google.gerrit.reviewdb.client.Account; +import com.google.gerrit.reviewdb.client.Change; + +import java.util.Set; + +public class MyPlugin implements ReviewerSuggestion { + public Set<SuggestedReviewer> suggestReviewers( + Change.Id changeId, String query, Set<Account.Id> candidates){ + Set<SuggestedReviewer> suggestions = new HashSet<>(); + // Implement your ranking logic here + return suggestions; + } +} +---- + +  == SEE ALSO    * link:js-api.html[JavaScript API]